<%--
  Created by IntelliJ IDEA.
  User: 29960
  Date: 2022/8/25
  Time: 9:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%String path=request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>本店评论</title>
    <link type="text/css" rel="stylesheet" href="<%=path%>/admin/car/fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="<%=path%>/admin/car/css/style.css"/>
</head>
<body>
<div class="main_box">
    <h2><span></span>本店评论</h2>
    <div class="cont_box">
        <form action="#" method="post" id="staff_form">
            <div class="search_formbox clearfix">
                <a href="${pageContext.request.contextPath}/admin/findAllCom"><button type="button" id="all" class="btn blue_btn curr">全部评论</button></a>
                <a href="${pageContext.request.contextPath}/admin/findHp"><button type="button" id="paise" class="btn blue_btn">好评<sub>（${hps}）</sub></button></a>
                <a href="${pageContext.request.contextPath}/admin/findCp"><button type="button" id="bad" class="btn blue_btn">差评<sub>（${cps}）</sub></button></a>
                <a href="${pageContext.request.contextPath}/admin/findByIdCom"><button type="button" id="bad1" class="btn blue_btn">添加评论</button></a>
            </div>
            <table border="0" cellspacing="0" cellpadding="0" class="table" id="table_box">
                <thead>
                <tr>
                    <th>订单号</th>
<%--                    <th>服务时间</th>--%>
                    <th>评价时间</th>
                    <th>评价内容</th>
                    <th>评分</th>
                    <th>会员</th>
                    <th width="268">操作</th>
                </tr>
                </thead>
                <c:forEach items="${pageInfo.list}" var="list">
                <tbody>
                <tr id="1"><!--此处id为进行编辑或删除时该条数据的唯一标识-->
                    <td>${list.d_Comment_number}</td>
                        <%--                    <td>2017-02-09</td>--%>
                    <td>${list.d_order_time}</td>
                    <td><div class="comment_text">${list.d_comment_time}</div></td>
                    <td>${list.d_scorce}</td>
                    <td>${list.d_reviewer}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/admin/findOneCom?cid=${list.d_Comment_number}" class="table_btn table_info see_btn">
                            <i class="fa fa-eye"></i>
                            <span>查看</span>
                        </a>
                    </td>
                </tr>
<%--                <tr id="2">--%>
<%--                    <td>89542233</td>--%>
<%--                    <td>2017-01-09</td>--%>
<%--                    <td>2017-03-09</td>--%>
<%--                    <td><div class="comment_text">这里是评价内容这里是评价内容这里是评价内容这里是评价内容这里是评价内容这里是评价内容</div></td>--%>
<%--                    <td>4</td>--%>
<%--                    <td>赵四</td>--%>
<%--                    <td>--%>
<%--                        <a href="view_Comment.html" class="table_btn table_info see_btn">--%>
<%--                            <i class="fa fa-eye"></i>--%>
<%--                            <span>查看</span>--%>
<%--                        </a>--%>
<%--                    </td>--%>
<%--                </tr>--%>
                </tbody>
                </c:forEach>
                共 [${pageInfo.total}] 条 | 共 [${pageInfo.pages}] 页 |
                <c:if test="${pageInfo.pageNum>1}">
                    [<a href="${pageContext.request.contextPath}/admin/findAllPageCom?pageNum=${pageInfo.pageNum-1}&pageSize=${pageInfo.pageSize}">上一页</a>] |
                </c:if>
                <c:if test="${pageInfo.pageNum<=1}">
                    上一页 |
                </c:if>
                当前是 [${pageInfo.pageNum}] 页 |
                <c:if test="${pageInfo.pageNum<pageInfo.pages}">
                    [<a href="${pageContext.request.contextPath}/admin/findAllPageCom?pageNum=${pageInfo.pageNum+1}&pageSize=${pageInfo.pageSize}">下一页</a>] |
                </c:if>
                <c:if test="${pageInfo.pageNum>=pageInfo.pages}">
                    [下一页]
                </c:if>
            </table>
        </form>
    </div>
</div>
<!--javascript include-->
<script src="<%=path%>/admin/car/js/jquery-2.2.1.min.js"></script>
<script src="<%=path%>/admin/car/js/jquery.dataTables.min.js"></script>
<script src="<%=path%>/admin/car/js/bootstrap-datepicker.js"></script>
<script src="<%=path%>/admin/car/js/jquery.validate.min.js"></script>
<script src="<%=path%>/admin/car/js/other.js"></script>
<script>
    $(function(){
        $("body").other({tableId:"#table_box",tableWrap:[3,5,6],tableAas:[ 0,"desc"]});
        $("body").tipWindow({method:"edit",Class:".see_btn",even:"click",tipTit:"评价详情",Twidth:"700",Theight:"300",editUrl:"#"});//editUrl 编辑请求地址
        //评论筛选
        $(".search_formbox .btn").click(function(){
            var dataId = $(this).prop("all"),//评价等级id
                that = $(this);
            $.ajax({
                type:"post",
                url:"${pageContext.request.contextPath}/admin/findAllCom",
                data:"id="+dataId,
                success:function(data){
                    that.addClass("curr").siblings().removeClass("curr");
                }
            });
        });
    });
</script>
</body>
</html>

